<?php
class CscCookie {
    public $expire;
    
    public function init()
    {
    	
    }
    
    public function setValue($name,$value){
    	$cookie = new CHttpCookie($name,$value);
    	$cookie->expire = time()+ $this->expire;//60*60*24*30;  //有限期30天
    	Yii::app()->request->cookies->add($name,$cookie);
    	$cookies = Yii::app()->request->getCookies();
    }
    
    public function getValue($name){
    	$cookie = Yii::app()->request->getCookies();
    	return setDefault($cookie[$name], 'value');
    }
}